package demo1;

class MyArray {
    public Object[] array = new Object[10];

    public void setArray(int pos, Object value) {
        array[pos] = value;
    }

    public Object getArray(int pos) {
        return array[pos];
    }
}

public class Test2 {
    public static void main(String[] args) {
        MyArray arr = new MyArray();
        arr.setArray(0,10);
        arr.setArray(1,"String");
        arr.setArray(2,3.14);

        int a = (int)arr.getArray(0);
        String str = (String)arr.getArray(1);
        double b = (double)arr.getArray(2);

        System.out.println(a);
        System.out.println(str);
        System.out.println(b);
    }
}
